proposal for streaming NativeEventCollector#5065
Merged
supervacuus merged 1 commit intofeat/tombstone_native_sdk_mergefrom Jan 29, 2026
Merged
Conversation
8 tasks
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d091211 | 325.47 ms | 371.58 ms | 46.11 ms |
| 6ad3f8e | 313.98 ms | 362.27 ms | 48.29 ms |
| 14ebc28 | 320.09 ms | 398.66 ms | 78.57 ms |
| dc79daa | 333.69 ms | 382.49 ms | 48.80 ms |
| 7aef08b | 286.72 ms | 361.82 ms | 75.09 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d091211 | 1.58 MiB | 2.19 MiB | 622.38 KiB |
| 6ad3f8e | 1.58 MiB | 2.19 MiB | 622.25 KiB |
| 14ebc28 | 1.58 MiB | 2.20 MiB | 637.07 KiB |
| dc79daa | 1.58 MiB | 2.19 MiB | 622.86 KiB |
| 7aef08b | 1.58 MiB | 2.19 MiB | 622.25 KiB |
markushi
approved these changes
Jan 29, 2026
| * remainder of the section on close to position the stream at the next envelope item. Does not | ||
| * close the underlying stream. | ||
| */ | ||
| private static final class BoundedInputStream extends InputStream { |
df83d57
into
feat/tombstone_native_sdk_merge
65 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal for an adaptation to the
NativeEventCollectorintroduced in #5037:extractNativeEventFromFile()to load the full envelope and event.I used the envelopes from the core test resources, copied them to the
sentry-android-coretest resource folder, and added a couple of native-specific envelopes for the tests.This limits memory usage as much as possible since there are at best 10
ApplicationExitInfowithEXIT_REASON_NATIVE(likely fewer), which act as an upper bound to the number of envelopes/events we fully decode.It should also be much fairer on the CPU, since much less decoding/deserialization is required. I/O will be the same during collection; however, with this approach, we must read the matching envelopes from disk again during full decode.
#skip-changelog